package org.tailor
/**
 * The News entity.
 *
 * @author    
 *
 *
 */
class News {
    static mapping = {
        table 'news'
        // version is set to false, because this isn't available by default for legacy databases
        version false
        // In case a sequence is needed, changed the identity generator for the following code:
        //       id generator:'sequence', column:'id', params:[sequence:'news_sequence']
        id generator:'identity', column:'id'
        designIdDesign column:'design_id'
    }
    Long id
    Integer discount
    Date endDate
    Integer type
    String content
    // Relation
    Design designIdDesign

    static constraints = {
        id(max: 9223372036854775807L)
        discount(nullable: true, max: 100)
        endDate(nullable: true)
        type(nullable: true, max: 2147483647)
        content()
        designIdDesign()
    }
    String toString() {
        return "${id}" 
    }
}

